- content_for :title do
  = "编辑 #{resource_name.to_s.humanize}"

.row
  .col-md-12
    .card
      .card-header.card-border
        h3.card-title 个人信息
      .card-body
        = simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
          = f.error_notification

          = f.input :username, required: true, :autofocus => true
          = f.input :email, required: true, autofocus: true, hint: ''

          - if devise_mapping.confirmable? && resource.pending_reconfirmation?
            p
              | 等待确认邮件:
              = resource.unconfirmed_email

          = f.input :password, label: '新密码',
                    input_html: { autocomplete: "new-password" }
          = f.input :password_confirmation, label: '重复新密码',
                    input_html: { autocomplete: "new-password" }
          = f.submit '更新', class: 'btn btn-lg btn-primary'

    .card.card-info
      .card-header.card-border
        h3.card-title API
      .card-body
        .form-group
          label 密钥
          input type="text" class="form-control" disabled="true" value="#{@user.token}"

    .card.card-danger
      .card-header.card-border
        h3.card-title 注销您的账户
      .card-body
        p
          | 注销账户后，您的数据将会彻底移除！
        = button_to "确认注销", registration_path(resource_name), data: { confirm: "最后确认你要注销自己的账户?" }, method: :delete, class: 'btn btn-lg btn-danger'